﻿@model LynxWiki.ViewModels.TopicVersionViewData

@using LynxWiki.ViewModels;

@{
    ViewBag.Title = Model.TopicName;
    Layout = "~/Views/Shared/_LayoutTopic.cshtml";
}

<span id="TopicTip" class="TopicTip" ></span>
@Html.Partial("_TopicDisplayName", new TopicDisplayName { DisplayName = Model.TopicName })
@Html.Raw(Model.Topic.HtmlText)
<p>Version: @Html.DisplayFor(model => model.Topic.Version)&nbsp;&nbsp;&nbsp;Revised: @Html.DisplayFor(model => model.Topic.CreatedOn) Last Updated by: @Html.DisplayFor(model => model.Topic.Creator)
    @if (User.IsInRole("WikiAdmin")) {
        if (Model.TopicLock) {
                            <a href="@Url.RouteUrl("Default", new { action = "WikiTopicLockAction", controller = "WikiTopic", topicName = Model.TopicName + "__current.xml", wikiDir = Model.Topic.WikiDir, pagePath = Model.PagePath, lockAction = "unlock" })">
                Unlock</a>
        }
        else {
                <a href="@Url.RouteUrl("Default", new { action = "WikiTopicLockAction", controller = "WikiTopic", topicName = Model.TopicName + "__current.xml", wikiDir = Model.Topic.WikiDir, pagePath = Model.PagePath, lockAction = "lock" })">
                Lock</a>
        }
    }
    @if (Model.AllowUpdate && !Model.TopicLock) {
                <a href="@Url.RouteUrl("Default", new { action = "TopicRename", controller = "WikiTopic", topicName = Model.TopicName, pagePath = Model.PagePath })">
                Rename</a>
    }
    <a href="@Url.RouteUrl("Default", new { action = "TopicInboundLinks", controller = "WikiTopic", topicName = Model.TopicName, pagePath = Model.PagePath })" target="_blank">
                Show Links to Topic</a>
</p>

